package com.liugui.basicsgrammar;

public class BitOperation{
    public static void main(String[] args){
        int a=60,b=13;
        System.out.println("a & b = " + (a & b)); //按位与
        System.out.println("a | b = " + (a | b)); //按位或
        System.out.println("a ^ b = " + (a ^ b)); //按位异或
        System.out.println("~a = " + (~a));       //按位补
        System.out.println("a << 2 = " + (a << 2));//按位左移
        System.out.println("a >> 2 = " + (a >> 2));//按位右移
        System.out.println("a >>> 2 = " + (a >>> 2));//按位右移补零
    }
}